const data = JSON.parse(localStorage.getItem('vuex'))

const state = {
  menuList: [
    {
      path: '/',
      name: '首页',
      redirect: '/dashboard',
      children: [
        {
          path: 'dashboard',
          component: () => import('@/views/Dashboard')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      hidden: true,
      component: () => import('@/views/Login')
    },
    {
      path: '*',
      hidden: true,
      name: '404',
      component: () => import('@/views/Error/404')
    },
    {
      path: '/menu1',
      name: '菜单一',
      children: [
        {
          path: '/menu1/submenu2',
          name: '子菜单二',
          component: () => import('@/views/Menu1/Submenu2')
        }
      ]
    }
  ],
  username: data ? data.username : null
}

export default state
